<?php
class CompanyArea extends AppModel {
	var $name = 'CompanyArea';
	var $useTable = 'company_area_inner';

	var $belongsTo = array('SysParams' =>  
                            array('className'  => 'SysParams', 
                                  'conditions' => "\"SysParams\".deleted is null AND \"SysParams\".kbn='area_id'",  
                                  'order'      => '',  
                                  'foreignKey' => 'company_area_id'  
                            )      
                      ); 	
	
	function deleteByCompanyId($companyId){
		$this->execute("update company_area_inner set deleted = now() where company_id=$companyId;");
	}
}
?>
